﻿<%@ Page Language="C#" MasterPageFile="~/admin/managemain.Master" AutoEventWireup="true" CodeBehind="submenu_set.aspx.cs" Inherits="uswinweb.admin.submenu_set" %>
<%@ Register TagPrefix="win" TagName="submenulist" Src="~/datacontrol/submenulist.ascx"%>
<asp:Content ID="Content1" ContentPlaceHolderID="headcontent" runat="server">
<script language="javascript" type="text/javascript" src="../js/modalpopup.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="maincontent" runat="server">
<div class="cot">
	<div class="adnr">
		<ul class="adnr2 mar_top">
			<li><a href="#" onclick="newMenu();">新 增</a></li>
		</ul>
		<div class="adnr3" >
            <div id="showdata">
			    <win:submenulist runat="server" ID="submenulist" />
            </div>
		</div>
		<i class="tp"></i><i class="bt"></i>
	</div>
</div>
    <div id="BOX_overlay" style="background: #000; position: absolute; z-index: 100; filter: alpha(opacity=50); -moz-opacity: 0.6; opacity: 0.6;">
    </div>
    <div id="neworeditsubmenuitem" style="display: none; background: #fff; padding: 10px; border: 1px solid #999; width: 400px;">
        <div class="ManagerForm">
            <fieldset>
                <legend id="opt" style="background: url(../images/icons/icon53.jpg) no-repeat 6px 50%;">
                    新建子菜单</legend>
                <table cellspacing="0" cellpadding="4" class="adtb" width="80%">
                    <tr>
                        <td width="25%"><p class="zi1">菜单名称:</p>
                            <input type="hidden" id="id" name="id" value="0" />
                        </td>
                        <td>
                            <p class="zi2"><input id="menutitle" name="menutitle" type="text" maxlength="8" size="10" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">页面地址:</p>
                        </td>
                        <td>
                            <p class="zi2"><input id="defaulturl" name="defaulturl" type="text" maxlength="100" size="30" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">英文名称:</p>
                        </td>
                        <td>
                            <p class="zi2"><input id="etitle" name="etitle" type="text" maxlength="100" size="30" class="soout" onfocus="this.className='soon';" onblur="this.className='soout';" /></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">操作实体:</p>
                        </td>
                        <td>
                            <p class="zi2">
                            <select id="opmode" name="opmode">
                            <option value="0" selected="selected">请选择操作实体</option>
                            <%
                                LTJ.Entity.OPMode opmodes = new LTJ.Entity.OPMode();
                                foreach (string cname in Enum.GetNames(opmodes.GetType()))
                                {
                                    int s_value = Convert.ToInt16(Enum.Parse(opmodes.GetType(), cname));
                            %>
                            <option value="<%=s_value%>"><%=LTJ.Entity.EnumType.GetOpModeName(s_value)%></option>
                            <%
                                }        
                            %>
                            </select>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                        <input type="submit" value="提 交" class="save" onclick="chkSubmit();"/>
                            &nbsp;&nbsp;
                        <input type="button" value="取 消" class="save" onclick="BOX_remove('neworeditsubmenuitem');" />
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div>
    </div>
    <div id="setting" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footcontent" runat="server">
<script type="text/javascript">
    function newMenu() {
        document.getElementById("opt").innerHTML = "新建主菜单";
        document.getElementById("id").value = "-1";
        document.getElementById("menutitle").value = "";
        document.getElementById("defaulturl").value = "";
        document.getElementById("etitle").value = "";
        document.getElementById("opmode").value = 0;
        BOX_show('neworeditsubmenuitem');
    }
    function editMenu(menuid, menutitle, defaulturl, etitle, opvalue) {
        document.getElementById("opt").innerHTML = "编辑主菜单";
        document.getElementById("id").value = menuid;
        document.getElementById("menutitle").value = menutitle;
        document.getElementById("defaulturl").value = defaulturl;
        document.getElementById("etitle").value = etitle;
        document.getElementById("opmode").value = opvalue;
        BOX_show('neworeditsubmenuitem');
    }
    function chkSubmit() {
        if (document.getElementById("menutitle").value == "") {
            alert("主菜单名称不能为空！");
            document.getElementById("menutitle").focus();
            return false;
        }
        if (document.getElementById("defaulturl").value == "") {
            if (!confirm("您确认要将默认展现页面地址置空吗？")) {
                document.getElementById("defaulturl").focus();
                return false;
            }
        }
        if (document.getElementById("etitle").value == "") {
            if (!confirm("主菜单英文名称不能为空！")) {
                document.getElementById("etitle").focus();
                return false;
            }
        }
        //document.getElementById("<%=Form.ClientID%>").submit();
        return true;
    }
</script>
</asp:Content>
